package com.zhaoxi.project.fms.service.impl;

import com.zhaoxi.common.utils.DateUtils;
import com.zhaoxi.framework.web.BaseService;
import com.zhaoxi.project.fms.domain.FmsClassification;
import com.zhaoxi.project.fms.mapper.FmsClassificationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 财务单据Service业务层处理
 *
 * @author zhaoxi
 * @date 2023-08-14
 */
@Service
public class FmsClassificationServiceImpl extends BaseService {
    @Autowired
    private FmsClassificationMapper fmsClassificationMapper;

    /**
     * 查询记账科目信息
     *
     * @param code 记账科目信息主键
     * @return 记账科目信息
     */

    public FmsClassification selectFmsClassificationByCode(String code) {
        return fmsClassificationMapper.selectFmsClassificationByCode(code);
    }

    /**
     * 查询记账科目信息列表
     *
     * @param fmsClassification 记账科目信息
     * @return 记账科目信息
     */

    public List<FmsClassification> selectFmsClassificationList(FmsClassification fmsClassification) {
       
        return   fmsClassificationMapper.selectFmsClassificationList(fmsClassification);
    }

    /**
     * 新增记账科目信息
     *
     * @param fmsClassification 记账科目信息
     * @return 结果
     */

    public int insertFmsClassification(FmsClassification fmsClassification) {
        return fmsClassificationMapper.insertFmsClassification(fmsClassification);
    }

    /**
     * 修改记账科目信息
     *
     * @param fmsClassification 记账科目信息
     * @return 结果
     */

    public int updateFmsClassification(FmsClassification fmsClassification) {
        fmsClassification.setUpdateTime(DateUtils.getNowDate());
        return fmsClassificationMapper.updateFmsClassification(fmsClassification);
    }
    

    /**
     * 批量删除记账科目信息
     *
     * @param codes 需要删除的记账科目信息主键
     * @return 结果
     */

    public int deleteFmsClassificationByCodes(String[] codes) {
        return fmsClassificationMapper.deleteFmsClassificationByCodes(codes);
    }

    /**
     * 删除记账科目信息信息
     *
     * @param code 记账科目信息主键
     * @return 结果
     */

    public int deleteFmsClassificationByCode(String code) {
        return fmsClassificationMapper.deleteFmsClassificationByCode(code);
    }


}










